#ifndef LR_TABLE_HPP
#define LR_TABLE_HPP

#include <cstdio>
#include <string>
#include <unordered_map>

struct TableItem {
  bool isReduction;
  int num;
};

class LRTable {
  friend class LRTableBuilder;

private:
  std::unordered_map<std::string, TableItem> table;

public:
  TableItem query(int statusNum, std::string symbol) const {
    // auto numStr = std::to_string(statusNum);
    // if (table.count(numStr)) {
    //   return table[numStr];
    // }
    printf("lookup: %s\n", (std::to_string(statusNum) + symbol).c_str());
    return table.at(std::to_string(statusNum) + symbol);
  }
};

#endif // !LR_TABLE_HPP
